package classwork;

import classwork_domain.Dog;

public class Demo3 {
    public static void main(String[] args) {
        // 根据狗类创建实例对象
        Dog dog = new Dog();
        // 根据对象调用属性以及行为
        // 调用属性
        String name = dog.name;
        System.out.println("name = " + name);

        System.out.println("dog.age = " + dog.age);
        System.out.println("dog.height = " + dog.height);

        // 调用行为
        dog.eat();
        dog.sleep();
    }
}
